package com.springcloudalibaba.user;

public class CurrentUser {
    private final static ThreadLocal<User> USER_INFO = new ThreadLocal<>();

    public static void set(User user){
        USER_INFO.set(user);
    }

    public static User getCurrentUser(){
        return USER_INFO.get();
    }

    public static void clear(){
        USER_INFO.remove();
    }
}
